package game.mapEditor;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

public class MapEditFrame extends javax.swing.JFrame {
	
	private static final long serialVersionUID = 1L;

	public MapEditFrame() {
    	
        this.setSize(800, 600); //The window Dimensions
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        javax.swing.JPanel panel = new javax.swing.JPanel();
        panel.setBounds(20, 20, 1000, 800);
        
        WsAppletMapEditor editMap = new WsAppletMapEditor();
        panel.add(editMap);
        
        this.add(panel);
//        editMap.loadMap("map001");
        editMap.newMap("medium");
        editMap.newMap("medium");
        
        final DrawFunctions funct = editMap.getDrawFunctions();
        
        JButton walls = new JButton("walls");
        walls.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				funct.setTool(DrawFunctions.WALL);
			}
        });
        panel.add(walls);
        
        editMap.init(); //this is the function used to start the execution of the sketch
        this.setVisible(true);
        
    }
}